/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package interfaces.Interfaz1;

import controller.TopTen;
import java.awt.BorderLayout;

/**
 *
 * @author facu
 */
public class VentanaGanaste extends javax.swing.JFrame {

    
    TopTen ranking;
    int minutos;
    int segundos;
    int milisegundos;
    
    /**
     * Creates new form VentanaGanaste
     */
    public VentanaGanaste(int min, int seg, int mil) {
        initComponents();
        PanelFondoGanaste F = new PanelFondoGanaste();
        this.setResizable(false);
        this.add(F,BorderLayout.CENTER);
        this.pack();
        ranking = new TopTen();
        minutos=min;
        segundos=seg;
        milisegundos=mil;
        System.out.println(minutos+" "+segundos+" "+milisegundos);
    }
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        BotonContinuar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setPreferredSize(new java.awt.Dimension(1000, 693));

        BotonContinuar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/greenCubes2.jpg"))); // NOI18N
        BotonContinuar.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 4));
        BotonContinuar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotonContinuarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(BotonContinuar, javax.swing.GroupLayout.PREFERRED_SIZE, 1012, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(BotonContinuar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void BotonContinuarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotonContinuarActionPerformed
        System.out.println(ranking.posibleTop(minutos,segundos,milisegundos));
        System.out.println(minutos+" "+segundos+" "+milisegundos);
        if(ranking.posibleTop(minutos,segundos,milisegundos) || ranking.listaTopTen().size()<9){
            VentanaEntradaTopTen ventCarTop = new VentanaEntradaTopTen(minutos,segundos,milisegundos);
            ventCarTop.setVisible(true);
        }
            
        this.dispose();
    }//GEN-LAST:event_BotonContinuarActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BotonContinuar;
    // End of variables declaration//GEN-END:variables
}
